<template>
	<view class="mainpadding">
		<u-modal :show="show" cancelColor="#555" confirmColor="#FD463E" :showCancelButton="true" :title="title"
			@cancel="cancel" @confirm="confirm"></u-modal>
		<header-top :messageInfo="{typeFlag:true,message:'设置',liner:false}"></header-top>
		<view class="flexbetween xiahuax" @click="toshdz">
			<view class="notitletext">收货地址</view>
			<view class="righticon"></view>
		</view>
		<view class="flexbetween xiahuax margin_top" @click="tzgywm">
			<view class="notitletext">关于我们</view>
			<view class="righticon"></view>
		</view>
		<view class="flexbetween xiahuax margin_top" @click="tzyjfk">
			<view class="notitletext">意见反馈</view>
			<view class="righticon"></view>
		</view>
		<view class="flexbetween xiahuax margin_top" @click="toyszc">
			<view class="notitletext">隐私政策</view>
			<view class="righticon"></view>
		</view>
		<view class="margin_top6">
			<view class="bigbtn" @click="show = true">退出登录</view>
		</view>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				show: false,
				title: '确定要退出当前账户么？',
			}
		},
		methods: {
			toyszc(){
				uni.navigateTo({
					url:'/pages/mypage/guanyuwomen?type=2'
				})
			},
			toshdz(){
				uni.navigateTo({
					url:'/pages/homepage/shouhuodizhi'
				})
			},
			// 跳转意见反馈
			tzyjfk(){
				uni.navigateTo({
					url:'/pages/mypage/yijianfank'
				})
			},
			// 跳转关于我们
			tzgywm(){
				uni.navigateTo({
					url:'/pages/mypage/guanyuwomen?type=1'
				})
			},
			cancel() {
				this.show = false
			},
			confirm() {
				this.show = false;
				// 将存储的数据改为空达到退出登录的效果
				uni.setStorageSync('token', "");
				httpRequest.toast("退出登录成功")
				setTimeout(() => {
					uni.redirectTo({
						url: '/pages/login/login'
					})
				}, 1000)
			},
			
		}
	}
</script>

<style lang="scss" scoped>
	.xiahuax {
		padding: 20rpx 0;
		border-bottom: 2rpx solid rgba(153, 153, 153, 0.05);
	}
</style>
